<?php $this->Html->addCrumb('Resources', '/Resources'); ?>
<?php $this->Html->addCrumb('Add'); ?>

<?php echo $this->Form->create('Resource',array('enctype'=>'multipart/form-data', 'class' => 'form form-horizontal')); ?>

	<?php
		echo $this->Form->input('resource_title', array(
												'label' => array('text' => 'Title', 'class'=>'control-label'),
												'div' =>'control-group',
												'error' => array(
													'wrap' => 'div', 
													'class' => 'formerror')
													));
		echo $this->Form->input('resource_description', array(
												'label' => array('text' => 'Description', 'class'=>'control-label'),
												'div' => 'control-group',
												'error' => array(
													'wrap' => 'div', 
													'class' => 'formerror')
													));
		echo $this->Form->input('resource_category',array(
									'options'=>$categories,			
									'label'=> array('text' => 'Category', 'class'=>'control-label'),
									'div' => 'control-group',
									'error' => array(
										'wrap' => 'div', 
										'class' => 'formerror'
										)
									));
		?>
		<div class="control-group">
			<div class="input-append date datetime">
				<?php echo $this->Form->input('resource_date',array('type' => 'text','div' => false, 'label' => array('text' =>'Upload Date', 'class'=>'control-label'), 'wrapInput' => false));?>
					<span class="add-on"><i class="icon-calendar"></i></span>
			</div>
		</div>
		<?php
		
		echo $this->Form->file('resource_link', array(
												'label' => array('text' => 'Select File', 'class'=>'control-label'),
												'div' => 'control-group',
												'error' => array(
													'wrap' => 'div', 
													'class' => 'formerror')
													));
	?>
<div class="modal-footer">
		<a href="#" class="btn" data-dismiss="modal" aria-hidden="true">Close</a>
		<?php echo $this->Form->end(array(
		'label' => 'Add Resource',
		'class' => 'btn btn-primary',
		'div' => false
	   )); ?>
	  </div>

	  <script>
		$('.datetime').datetimepicker({
			format: 'yyyy-mm-dd',  //format: 'yyyy-MM-dd hh:mm:ss' either one works     
			language: 'en',
			startView: 4,
			endDate: '+1d',
			minView: 2,
			autoclose: 1,
			forceParse: 1,
			todayBtn: 0
		  });
		  
</script>